<%@ include file="/taglibs.jsp"%>
<%@ page
	import="java.util.List,java.util.Iterator,com.stable.model.TblAbteilung,com.stable.model.TblRolle"%>
<script language="JavaScript" src="md5.js"></script>
<script language="JavaScript">
            function doLogin()
            {
           if (document.forms[0].j_password.value == '')
            {
              alert("Bitte geben Sie ein Passwort ein"); 
              return false;
              }else if(document.forms[0].loginname.value == ''){
                            alert("Bitte geben Sie ein Loginname ein"); 
              return false;
              
              }
              else if(document.forms[0].firstname.value == ''){
              
                            alert("Bitte geben Sie ein Vorname ein"); 
              return false;
              }
              else if(document.forms[0].lastname.value == ''){
                            alert("Bitte geben Sie ein Nachname ein"); 
              return false;
              
              }else{
                document.forms[0].j_password.value = hex_md5(document.forms[0].j_password.value);
            return true;
            }

            }
        </script>

<table class="wm_hide" id="info">

	<tr>
		<td class="wm_info_message" id="info_message"></td>
	</tr>
</table>
<div align="center" id="content">
<div class="wm_logo" id="logo" tabindex="-1"></div>
<div id="login_screen">
<div class="wm_hide" id="login_error"></div>

<html:form action="mitarbeiter.do?method=MitarbeiterSpeichern"
	onsubmit="return doLogin()">


	<table class="wm_login wm_fixed" id="login_table" border="0"
		cellspacing="0" cellpadding="0">
		<col width="100"></col>
		<col width="88"></col>
		<col width="70"></col>
		<col width="33"></col>
		<col width="42"></col>
		<tr>


			<td class="wm_login_header" colspan="5"><bean:message
				key="mitabeiterNeu" /></td>
		</tr>

		<tr>
			<td class="wm_title" width="299"><bean:message key="firstName" /> *:</td>

			<td colspan="4"><html:text name="userForm" property="firstname"
				styleClass="wm_input" maxlength="255"
				onfocus="this.className = 'wm_input_focus';"
				onblur="this.className = 'wm_input';" /></td>
		</tr>
		<tr>
			<td class="wm_title" width="299"><bean:message key="lastName" />*:</td>

			<td colspan="4"><html:text name="userForm" property="lastname"
				styleClass="wm_input" maxlength="255"
				onfocus="this.className = 'wm_input_focus';"
				onblur="this.className = 'wm_input';" /></td>
		</tr>

		<tr id="login_cont">
			<td class="wm_title" width="299"><bean:message key="username" />:*</td>
			<td colspan="4"><html:text name="userForm" property="loginname"
				styleClass="wm_input" maxlength="255"
				onfocus="this.className = 'wm_input_focus';"
				onblur="this.className = 'wm_input';" /></td>
		</tr>
		<tr>
			<td class="wm_title" width="299"><bean:message key="password" />:*</td>

			<td colspan="4"><html:password name="userForm"
				property="j_password" styleClass="wm_input" maxlength="255"
				onfocus="this.className = 'wm_input_focus';"
				onblur="this.className = 'wm_input';" /></td>
		</tr>
		<tr>
			<td class="wm_title" width="299"><bean:message key="abteilung" />:</td>
			<td colspan="4">
			<%
						List alleAbteilungen = (List) request
						.getAttribute("alleAbteilungen");
				if (alleAbteilungen != null) {
			%> <html:select property="abtId" size="1"
				onfocus="this.className = 'wm_input_focus';"
				onblur="this.className = 'wm_input';">
				<%
						for (Iterator iterator = alleAbteilungen.iterator(); iterator
						.hasNext();) {
							TblAbteilung abt = (TblAbteilung) iterator.next();
				%>
				<html:option value="<%=String.valueOf(abt.getAbteilungId())%>">
					<%=abt.getName()%>
				</html:option>


				<%
				}
				%>
			</html:select> <%
 }
 %>
			</td>

		</tr>
		<tr>
			<td class="wm_title" width="299"><bean:message key="rolle" />:</td>
			<td colspan="4" class="wm_input">
			<%
				List alleRollen = (List) request.getAttribute("alleRollen");
				if (alleRollen != null) {
			%> <html:select property="rolleId" size="1"
				onfocus="this.className = 'wm_input_focus';"
				onblur="this.className = 'wm_input';">
				<%
						for (Iterator iterator = alleRollen.iterator(); iterator
						.hasNext();) {
							TblRolle rolle = (TblRolle) iterator.next();
				%>
				<html:option value="<%=String.valueOf(rolle.getRolleId())%>">
					<%=rolle.getBez()%>
				</html:option>


				<%
				}
				%>
			</html:select> <%
 }
 %>
			</td>

		</tr>
		<tr>
			<td colspan="5"><span class="wm_login_button"> <input
				class="wm_button" type="submit"
				value='<bean:message key="link.form.save"/>' /> </span></td>
		</tr>
	</table>
</html:form></div>
</div>
